<template>
  <div>
    <input :value="props.hello" @input="updateHello" />
    <span>子组件：{{ props.hello }}</span>
    <br />
    <input :value="props.word" @input="updateWord" />
    <span>子组件：{{ props.word }}</span>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({ hello: String, word: String });

let emit = defineEmits(["update:hello", "update:word"]);

// 4.使用多v-model
const updateHello = (event: any) => {
  emit("update:hello", event.target.value);
};
const updateWord = (event: any) => {
  emit("update:word", event.target.value);
};
</script>
